-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update UIContainerLayouts.kt so graphics{} work better #2166
Conversation
Update UIContainerLayouts.kt so graphics{} work better
Thanks! We will need to do the same for the rest, including UIHorizontalStack, etc. |
Fixes #2164 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need two things:
- Update UIHorizontalStack too.
- Add a test that checks the new behaviour.
My suggestion for the test is the following:
@Test
fun testUIVerticalStack() {
val stack = UIVerticalStack()
val view1 = stack.solidRect(10, 10, Colors.RED)
val view2 = stack.graphics { fill(Colors.RED) { rect(10, 10, 20, 20) } }
val view3 = stack.solidRect(10, 10, Colors.RED)
stack.relayout()
assertEquals("...", "${view1.y.niceStr},${view2.y.niceStr},${view3.y.niceStr}")
}
By applying/reverting this change the view3.y should be different. So that will cover that we have fixed the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you very much! |
Fixes #2164